<template>
  <div class="alert-body" v-if="dialogVisible">
    <div class="alert-box">
      <div class="alert-box-header">
        <span>实时区角参与信息</span>
        <span class="iconfont iconguanbi" @click="closeModle"></span>
      </div>
      <div class="alert-box-body">
        <div class="teacher-content">
          <div class="teacher-content-list" v-for="(item,index) in cornerList" :key="index">
            <div class="teacher-content-list-img">
              <img :src="item.pic" alt="">
            </div>
            <span class="teacher-content-list-name overflow-01">{{item.name}}</span>
          </div>
        </div>
      </div>
      <div class="alert-box-footer">
        <span @click="closeModle">返回</span>
      </div>
    </div>
  </div>
</template>
<script>
import {cornerStudentBrand} from "@/api/admin/school";
import popupCornerList from "@/fullscreen/components/popupCornerList";

export default {
  name: "foodData",
  props: ['visible', 'cornerDetail'],
  components: {popupCornerList},
  data() {
    return {
      typeData: 'food_check',
      foodCodeVisible: false,
      dialogVisible: false,
      cornerList: [],
      showPopup: false,
      cornerId: 0,
      sectionId: '',
      cornerName: '',
      sectionName: ''
    };
  },
  watch: {
    visible() {
      this.dialogVisible = this.visible
      if (this.visible) {
        this.cornerStudentFn()
      } else {
        this.cornerList = []
      }
    }
  },
  created() {
  },
  mounted() {

  },
  methods: {
    // 单天预约的学生
    cornerStudentFn() {
      const loading = this.$loading({
        lock: true,
        text: '加载中…',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      });
      cornerStudentBrand({
        id: this.cornerDetail.id
      }).then(res => {
        console.log('学生:', res)
        this.cornerList = res.list
        setTimeout(() => {
          loading.close();
        }, 1000);
      })
    },
    closeModle() {
      this.$emit('update:visible', false)
    }
  }
};
</script>
<style scoped>
.alert-body {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert-box {
  width: 85%;
  height: 85%;
  border: 1px solid #005da6;
  background: rgba(13, 17, 44, .8);
  display: flex;
  flex-direction: column;
  border-radius: 10px;
}

.alert-box-header {
  height: 60px;
  display: flex;
  color: #beebfe;
  font-size: 26px;
  padding: 0 20px;
  line-height: 60px;
}

.alert-box-header .iconfont {
  font-size: 26px;
  cursor: pointer;
  margin-left: 20px;
  padding: 0 10px;
}

.alert-box-header span:first-child {
  flex: 1;
}

.alert-box-footer {
  height: 80px;
}

.alert-box-body {
  flex: 1;
  padding: 0 10px;
  overflow-y: auto;
}


.alert-box-list-in i {
  color: #02d5ff;
  font-style: normal;
  font-size: 20px;
  font-weight: bold;
}

.alert-box-list-in em {
  font-style: normal;
}

.alert-box-footer {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert-box-footer span {
  display: block;
  border: 1px solid #beebfe;
  color: #beebfe;
  width: 180px;
  height: 50px;
  line-height: 48px;
  font-size: 20px;
  border-radius: 3px;
  cursor: pointer;
}

.alert-box-footer span:first-child {
  margin-right: 20px;
}

.alert-box-footer span:hover {
  background: rgba(0, 73, 85, 0.6);

}

.corner-data {
  overflow: hidden;
  background: rgba(255, 255, 255, .2);
  padding: 10px;
}

.corner-data-list {
  float: left;
  border: 1px solid #ddd;
  box-shadow: 0 2px 2px #ddd;
  border-radius: 5px;
  margin-right: 10px;
  margin-bottom: 10px;
  display: flex;
  padding: 10px 5px;
  cursor: pointer;
  flex-direction: column;
  background: #fff;
}

.corner-data-list:hover {
  border: 1px solid rgba(183, 211, 241, 0.9);
  background: rgba(183, 211, 241, 0.9);
  box-shadow: 0 2px 2px rgba(183, 211, 241, 0.9);
}

.corner-data-list-img {
  margin-right: 5px;
}

.corner-data-list-top-t {
  display: flex;
}

.corner-data-list-top-b {
  display: flex;
  margin-top: 10px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.corner-data-list-top-b .corner-data-list-right-line-l {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #eee;
}

.corner-data-list-top-b .corner-data-list-right-line-l:last-child {
  border: none;
}

.corner-data-list-top-b .corner-data-list-right-line-l i {
  font-size: 18px;
  color: #006dcd;
  font-weight: bold;
  font-style: normal;
}


.corner-data-list-right {
  display: flex;
}

.corner-data-list-right-line:first-child {
  width: 160px;
}

.corner-data-list-right-line {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.corner-data-list-right-line:nth-child(2) {
  width: 110px;
}

.corner-data-list-right-line:nth-child(3) {
  width: 130px;
}

.corner-data-list-right-line-l {
  display: flex;
  align-items: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.corner-data-list-right .corner-data-list-right-line-l span {
  color: #999;
  font-size: 13px;
}

.corner-data-list-right .corner-data-list-right-line-l i {
  font-style: normal;
}

.corner-data-list-img .el-image {
  width: 100px;
  height: 100px;
}

.teacher-content-list{
  float: left;
  background: rgba(43, 42, 70, 0.7);
  padding: 10px;
  border-radius: 10px;
  margin-right: 15px;
  margin-bottom: 15px;
  box-shadow: 0 0 2px #000;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.teacher-content-list-img{
  width: 195px;
  height: 250px;
  margin-bottom: 20px;
  border-radius: 5px;
}
.teacher-content-list-img img{
  width: 195px;
  height: 250px;
  display: block;
  border-radius: 5px;
}
.teacher-content-list-name{
  text-align: center;
  font-size: 22px;
  display: block;
  color: #fff;
  font-weight: bold;
  width: 166px;
}
.overflow-01{
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.teacher-content-list:hover{
  box-shadow: 0 1px 8px #7c5d00;
}
</style>
